package com.badibadi.activity;

import java.io.InputStream;

import com.badibadi.mytools.Conf;
import com.badibadi.mytools.ImageTool;
import com.badibadi.uniclubber.R;
import com.badibadi.uniclubber.R.layout;
import com.badibadi.uniclubber.R.menu;
import com.baidu.mobstat.StatService;

import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.RelativeLayout;

public class AboutConsultingFeesActivity extends BaseActivity {
	private RelativeLayout relative_uniclubber_1, relative_uniclubber_2,
			relative_uniclubber_3, relative_uniclubber_4,
			relative_uniclubber_5, relative_uniclubber_6;

	@SuppressWarnings("deprecation")
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		goToTheTitle();
		setContentView(R.layout.activity_about_consulting_fees);
		relative_uniclubber_1 = (RelativeLayout) this
				.findViewById(R.id.relative_uniclubber_1);
		relative_uniclubber_2 = (RelativeLayout) this
				.findViewById(R.id.relative_uniclubber_2);
		relative_uniclubber_3 = (RelativeLayout) this
				.findViewById(R.id.relative_uniclubber_3);
		relative_uniclubber_4 = (RelativeLayout) this
				.findViewById(R.id.relative_uniclubber_4);
		relative_uniclubber_5 = (RelativeLayout) this
				.findViewById(R.id.relative_uniclubber_5);
		relative_uniclubber_6 = (RelativeLayout) this
				.findViewById(R.id.relative_uniclubber_6);
		this.findViewById(R.id.return_btn).setOnClickListener(
				new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						finish();
					}
				});
		// relative_uniclubber_1.setBackgroundResource(R.drawable.uniclubber1);
		relative_uniclubber_1.setBackgroundDrawable(ImageTool
				.bitmapToDrawableByBD(readBitMap(
						AboutConsultingFeesActivity.this,
						R.drawable.uniclubber1)));
		relative_uniclubber_2.setBackgroundDrawable(ImageTool
				.bitmapToDrawableByBD(readBitMap(
						AboutConsultingFeesActivity.this,
						R.drawable.uniclubber2)));
		relative_uniclubber_3.setBackgroundDrawable(ImageTool
				.bitmapToDrawableByBD(readBitMap(
						AboutConsultingFeesActivity.this,
						R.drawable.uniclubber3)));
		relative_uniclubber_4.setBackgroundDrawable(ImageTool
				.bitmapToDrawableByBD(readBitMap(
						AboutConsultingFeesActivity.this,
						R.drawable.uniclubber4)));
		relative_uniclubber_5.setBackgroundDrawable(ImageTool
				.bitmapToDrawableByBD(readBitMap(
						AboutConsultingFeesActivity.this,
						R.drawable.uniclubber5)));
		relative_uniclubber_6.setBackgroundDrawable(ImageTool
				.bitmapToDrawableByBD(readBitMap(
						AboutConsultingFeesActivity.this,
						R.drawable.uniclubber6)));
		// relative_uniclubber_2.setBackgroundResource(R.drawable.uniclubber2);
		// relative_uniclubber_3.setBackgroundResource(R.drawable.uniclubber3);
		// relative_uniclubber_4.setBackgroundResource(R.drawable.uniclubber4);
		// relative_uniclubber_5.setBackgroundResource(R.drawable.uniclubber5);
		// relative_uniclubber_6.setBackgroundResource(R.drawable.uniclubber6);
	}
	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		
	}
	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		
	}
	/**
	 * 以最省内存的方式读取本地资源的图片
	 * 
	 * @param context
	 * @param resId
	 * @return
	 */
	public static Bitmap readBitMap(Context context, int resId) {
		BitmapFactory.Options opt = new BitmapFactory.Options();
		opt.inPreferredConfig = Bitmap.Config.RGB_565;
		opt.inPurgeable = true;
		opt.inInputShareable = true;
		// 获取资源图片
		InputStream is = context.getResources().openRawResource(resId);
		return BitmapFactory.decodeStream(is, null, opt);
	}
}
